CAMEL-24087: camel-test-infra - Add UI support to camel infra run#24739
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 629 tested, 26 compile-only — current: 80 all testedMaveniverse Scalpel detected 655 affected modules (current approach: 80).
|
gnodet
left a comment
There was a problem hiding this comment.
Well-structured feature adding UI support to the camel test-infra run command. The design is clean and consistent across ~25 services.
Architecture:
@InfraServiceannotation getsuiSupportedattribute (defaultfalse) — services opt in at the annotation leveluiUrl()default method added to each*InfraServiceinterface — provides the URL to reach the service's web UIContainerEnvironmentUtil.isWithUi()— gates companion UI containers to CLI mode only (fixed-port), ensuring they never start during tests- Companion container pattern (e.g., Kafka UI) — starts alongside the main service, with proper shutdown lifecycle and graceful error handling
- JBang CLI —
InfraBaseCommandadds a "UI" column to the services list;InfraBaseDTOincludesuiSupportedin JSON output
Review:
- ✅ UI containers gated by
isWithUi()→isFixedPort()— no impact on test runs - ✅ Kafka companion container: proper lifecycle (
shutdown()stops UI first), exception-safe start (logs warning, doesn't fail the main service), host port exposure viaTestcontainers.exposeHostPorts() - ✅ Services with built-in UIs (CouchDB
/_utils, Consul/ui, Vault/ui, Infinispan/console) just adduiUrl()— no extra containers needed - ✅ Services without UIs return
nullfromuiUrl()(e.g., Artemis non-all variant, IBM MQ interface) - ✅ Test updated to pass the new
uiSupportedconstructor parameter - ✅ Generated metadata includes
uiSupportedfield - ✅ CI passing (all builds green)
- ✅ No new static analysis findings — all scanner hits are on pre-existing code
Nice feature — the ability to quickly access service UIs when running camel infra run from the CLI will be very useful for development and debugging.
Reviewed with Claude Code on behalf of gnodet. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
davsclaus
left a comment
There was a problem hiding this comment.
Nice work on this feature, @Croway — the design is clean and well thought out.
Summary:
- The
isWithUi()guard gated onisFixedPort()is a smart approach to ensure companion UI containers never start during tests. - All container images correctly use
mirror.gcr.ioper project guidelines. - Kibana exclusion (SSPL — Category X for ASF) shows proper attention to ASF licensing policy.
- Error handling around UI container startup (catch + warn) is solid.
- The reflection-based property discovery in
InfraRun(lines 200–217) automatically picks upuiUrl()without additional wiring — elegant.
One actionable item and two minor notes inline.
This review was generated by an AI agent (Claude Code on behalf of davsclaus) and may contain inaccuracies. Please verify all suggestions before applying.
8ecf077 to
f49d4a8
Compare
The failure is unrelated to this PR, and the build was successful before the lastest minor changes, I'd merge |
oscerd
left a comment
There was a problem hiding this comment.
Nice feature — and I like that the "UI" is companion admin-UI containers (Kafka UI, Mongo Express, pgAdmin, OpenSearch Dashboards, Redis Commander) surfaced via uiUrl()/testcontainers rather than an embedded server in the CLI, so there's no new in-process listener and nothing UI-driven executes commands. The tests-off-by-default (isWithUi() false in tests, --no-ui opt-out) design is sensible.
Two things before merge:
- CI is red on generated-catalog drift, not a flake.
build (17)passes the maven build but fails the "Fail if there are uncommitted changes" gate: regenerating leavescatalog/camel-catalog/.../test-infra/metadata.jsonandtest-infra/camel-test-infra-all/.../metadata.jsondirty, because the kafkauiSupportedvalue differs (truein the committed merge tree vsfalsefrom regeneration). A rebase onto current main + regenerate + commit of those two files should clear it — the generator wiring itself (CamelTestInfraGenerateMetadataMojoreadinguiSupported) is correct. - Security note (non-blocking, dev-tool): the companion UIs bind fixed host ports on all interfaces with no/default auth (Mongo Express
ME_CONFIG_BASICAUTH=false, pgAdmin hardcodedadmin, Kafka UIDYNAMIC_CONFIG_ENABLED=trueno auth, Redis Commander none). That's acceptable since this is gated tocamel infra run(operator-trusted, and the backing data services already bind 0.0.0.0 in that mode), but it's worth a line in the docs that runningcamel infra runwith UIs on an untrusted network exposes unauthenticated admin consoles, with--no-uias the mitigation. (Minor: the PR body says redis-commander is frommirror.gcr.io, but the image isghcr.io/joeferner/redis-commander:0.9.1.)
Reviewed with Claude Code on behalf of Andrea Cosentino. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
Summary
Claude Code on behalf of Croway
Add automatic UI container support to
camel infra run. When a service is started, a companion web UI is automatically started alongside it. For services with built-in UIs, the URL is exposed in the JSON output.uiSupportedfield to@InfraServiceannotation and propagate tometadata.jsoncatalogisWithUi()toContainerEnvironmentUtilgated onisFixedPort()— UI containers never start during testsUIcolumn tocamel infra listuiUrl()to 16 service interfaces with built-in UIs (Artemis, MinIO, RabbitMQ, Jaeger, Neo4j, Couchbase, IBM MQ, Keycloak, Consul, Solr, CouchDB, ArangoDB, Vault, Qdrant, Infinispan)mirror.gcr.io):Test plan
camel infra listshows UI columncamel infra run kafkastarts Kafka + Kafka UI (HTTP 200 on port 9080)camel infra run mongodbstarts MongoDB + Mongo Express (HTTP 200 on port 8081)camel infra run redisstarts Redis + Redis Commander (HTTP 200 on port 8082)camel infra run postgresstarts PostgreSQL + pgAdmin (HTTP 302 on port 5050)camel infra run artemisshowsuiUrlfor built-in admin consoleInfraTest,InfraRestartTest)